<template>
  <div class="padding">
    <!-- 头部区域 -->
    <div class="page-header">
      <div class="title-section">
        <h1 class="page-title">
          <span class="merchant-name"></span> 提现记录
        </h1>
        <router-link :to="'/distributor/commissions'" class="back-link">
          <i class="fas fa-arrow-left"></i> 返回佣金列表
        </router-link>
      </div>
    </div>

    <div class="margin-top">
      <el-table ref="multipleTableRef" :data="listData" style="width: 100%">
        <el-table-column type="selection" width="55" />

        <el-table-column property="order_on" label="订单编号"></el-table-column>

        <el-table-column property="user_name" label="名称"></el-table-column>

        <el-table-column property="address" label="地址"></el-table-column>

        <el-table-column label="提现金额">
          <template #default="scope">
            <div>¥{{ scope.row.pay_money }}</div>
          </template>
        </el-table-column>


        <el-table-column property="create_time" label="提现时间">
          <template #default="scope">
            <div>¥{{ scope.row.create_time }}</div>
          </template>
        </el-table-column>

        <!-- <el-table-column property="status" label="状态">
            <template #default="scope">
              <template v-for="item in payStatus">
                <el-tag class="ml-2" :key="item.id" :color="'#FFF'" v-if="scope.row.pay_status === item.value">
                  {{ item.label }}
                </el-tag>
              </template>
            </template>
          </el-table-column> -->

        <!-- <el-table-column label="操作" width="300">
        <template #default="scope">
          <div class="flex align-center">
            <el-button
              class="margin-left-xs"
              size="small"
              type="danger"
              @click="viewOrderDetail(order)"
              >查看详情</el-button
            >
          </div>
        </template>
      </el-table-column> -->
      </el-table>

      <!-- 分页区域 -->
      <div class="margin-top">
        <Pagination :total="total" @change="changePage" />
      </div>
    </div>
  </div>
</template>

<script lang='ts' setup>
import { onMounted, reactive, ref } from 'vue'
import useTableHook from '@/hooks/useTableHook'
import { GetPayDataListApi } from '@/api/index'
import Pagination from '@/components/admin/Pagination.vue'

const dialogVisible = ref(false)

const queryInfo = reactive({
  page: 1,
  limit: 10
})

onMounted(() => {
  initTable()
})

const open = () => {
  dialogVisible.value = true
}

const close = () => {
  dialogVisible.value = false
}

const {
  total,
  allData,
  listData,
  searchTable,
  initTable,
  changePage,
} = useTableHook(queryInfo, GetPayDataListApi)

defineExpose({
  open
})
</script>

<style lang='scss' scoped></style>
